package com.betterjr.modules.profit.entity;

import com.betterjr.common.annotation.*;
import com.betterjr.common.entity.BetterjrEntity;
import com.betterjr.common.selectkey.SerialGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

@Access(AccessType.FIELD)
@Entity
@Table(name = "t_scf_loan_share")
public class ScfLoanShare implements BetterjrEntity {
    /**
     * 主键ID
     */
    @Id
    @Column(name = "ID",  columnDefinition="INTEGER" )
    @MetaData( value="主键ID", comments = "主键ID")
    private Long id;

    @Column(name = "L_SERVICE_ID",  columnDefinition="INTEGER" )
    @MetaData( value="", comments = "")
    private Long serviceId;

    /**
     * 供应商名称
     */
    @Column(name = "C_CUSTNAME",  columnDefinition="VARCHAR" )
    @MetaData( value="供应商名称", comments = "供应商名称")
    private String custname;

    /**
     * 供应商代码
     */
    @Column(name = "C_CUSTCODE",  columnDefinition="VARCHAR" )
    @MetaData( value="供应商代码", comments = "供应商代码")
    private String custcode;

    /**
     * 供应商编号
     */
    @Column(name = "L_CUSTNO",  columnDefinition="INTEGER" )
    @MetaData( value="供应商编号", comments = "供应商编号")
    private Long custno;

    /**
     * 核心企业名称
     */
    @Column(name = "C_CORENAME",  columnDefinition="VARCHAR" )
    @MetaData( value="核心企业名称", comments = "核心企业名称")
    private String corename;

    /**
     * 核心企业编号
     */
    @Column(name = "L_CORENO",  columnDefinition="INTEGER" )
    @MetaData( value="核心企业编号", comments = "核心企业编号")
    private Long coreno;

    /**
     * 核心企业组织机构代码
     */
    @Column(name = "C_COREOPERORG",  columnDefinition="VARCHAR" )
    @MetaData( value="核心企业组织机构代码", comments = "核心企业组织机构代码")
    private String coreoperorg;

    /**
     * 资金方名称
     */
    @Column(name = "C_FACTORYNAME",  columnDefinition="VARCHAR" )
    @MetaData( value="资金方名称", comments = "资金方名称")
    private String factoryname;

    /**
     * 资金方编号
     */
    @Column(name = "L_FACTORYNO",  columnDefinition="INTEGER" )
    @MetaData( value="资金方编号", comments = "资金方编号")
    private Long factoryno;

    /**
     * 服务费收款日期
     */
    @Column(name = "C_GATHERING_DATE",  columnDefinition="CHAR" )
    @MetaData( value="服务费收款日期", comments = "服务费收款日期")
    private String gatheringDate;

    /**
     * 贷款项目交易金额
     */
    @Column(name = "F_LOAN_BALANCE",  columnDefinition="DECIMAL" )
    @MetaData( value="贷款项目交易金额", comments = "贷款项目交易金额")
    private BigDecimal loanBalance;

    /**
     * 服务费金额
     */
    @Column(name = "F_SERVICE_CHARGE",  columnDefinition="DECIMAL" )
    @MetaData( value="服务费金额", comments = "服务费金额")
    private BigDecimal serviceCharge;

    /**
     * 分润比例
     */
    @Column(name = "F_SHARE_SCALE",  columnDefinition="DECIMAL" )
    @MetaData( value="分润比例", comments = "分润比例")
    private BigDecimal shareScale;

    /**
     * 分润金额
     */
    @Column(name = "F_SHARE",  columnDefinition="DECIMAL" )
    @MetaData( value="分润金额", comments = "分润金额")
    private BigDecimal share;

    /**
     * 结算周期类型0 按季度结算  1 按月结算
     */
    @Column(name = "C_SETTLEACCOUNTS_TYPE",  columnDefinition="CHAR" )
    @MetaData( value="结算周期类型0 按季度结算  1 按月结算", comments = "结算周期类型0 按季度结算  1 按月结算")
    private String settleaccountsType;

    /**
     * 付款日期
     */
    @Column(name = "C_PAYDATE",  columnDefinition="CHAR" )
    @MetaData( value="付款日期", comments = "付款日期")
    private String paydate;

    /**
     * 付款时间
     */
    @Column(name = "C_PAYTIME",  columnDefinition="CHAR" )
    @MetaData( value="付款时间", comments = "付款时间")
    private String paytime;

    /**
     * 结算方式1：现金转账
     */
    @Column(name = "C_PAYTYPE",  columnDefinition="VARCHAR" )
    @MetaData( value="结算方式1：现金转账", comments = "结算方式1：现金转账")
    private String paytype;

    /**
     * 描述说明
     */
    @Column(name = "C_DESCRIPTION",  columnDefinition="VARCHAR" )
    @MetaData( value="描述说明", comments = "描述说明")
    private String description;

    /**
     * 状态0 作废   1 待付分润费  2 已付分润费
     */
    @Column(name = "C_BUSINSTATUS",  columnDefinition="CHAR" )
    @MetaData( value="状态0 作废   1 待付分润费  2 已付分润费", comments = "状态0 作废   1 待付分润费  2 已付分润费")
    private String businstatus;

    /**
     * 生成日期
     */
    @Column(name = "C_CREATEDATE",  columnDefinition="CHAR" )
    @MetaData( value="生成日期", comments = "生成日期")
    private String createdate;

    /**
     * 付款操作员名称
     */
    @Column(name = "C_PAY_OPERATORNAME",  columnDefinition="VARCHAR" )
    @MetaData( value="付款操作员名称", comments = "付款操作员名称")
    private String payOperatorname;

    /**
     * 付款操作员id
     */
    @Column(name = "L_PAY_OPERATORID",  columnDefinition="INTEGER" )
    @MetaData( value="付款操作员id", comments = "付款操作员id")
    private Long payOperatorid;

    /**
     * 分润主体
     */
    @Column(name = "SHARE_TYPE",  columnDefinition="VARCHAR" )
    @MetaData( value="分润主体", comments = "分润主体")
    private String shareType;

    private static final long serialVersionUID = 3561545464040768753L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public String getCustname() {
        return custname;
    }

    public void setCustname(String custname) {
        this.custname = custname;
    }

    public String getCustcode() {
        return custcode;
    }

    public void setCustcode(String custcode) {
        this.custcode = custcode;
    }

    public Long getCustno() {
        return custno;
    }

    public void setCustno(Long custno) {
        this.custno = custno;
    }

    public String getCorename() {
        return corename;
    }

    public void setCorename(String corename) {
        this.corename = corename;
    }

    public Long getCoreno() {
        return coreno;
    }

    public void setCoreno(Long coreno) {
        this.coreno = coreno;
    }

    public String getCoreoperorg() {
        return coreoperorg;
    }

    public void setCoreoperorg(String coreoperorg) {
        this.coreoperorg = coreoperorg;
    }

    public String getFactoryname() {
        return factoryname;
    }

    public void setFactoryname(String factoryname) {
        this.factoryname = factoryname;
    }

    public Long getFactoryno() {
        return factoryno;
    }

    public void setFactoryno(Long factoryno) {
        this.factoryno = factoryno;
    }

    public String getGatheringDate() {
        return gatheringDate;
    }

    public void setGatheringDate(String gatheringDate) {
        this.gatheringDate = gatheringDate;
    }

    public BigDecimal getLoanBalance() {
        return loanBalance;
    }

    public void setLoanBalance(BigDecimal loanBalance) {
        this.loanBalance = loanBalance;
    }

    public BigDecimal getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(BigDecimal serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

    public BigDecimal getShareScale() {
        return shareScale;
    }

    public void setShareScale(BigDecimal shareScale) {
        this.shareScale = shareScale;
    }

    public BigDecimal getShare() {
        return share;
    }

    public void setShare(BigDecimal share) {
        this.share = share;
    }

    public String getSettleaccountsType() {
        return settleaccountsType;
    }

    public void setSettleaccountsType(String settleaccountsType) {
        this.settleaccountsType = settleaccountsType;
    }

    public String getPaydate() {
        return paydate;
    }

    public void setPaydate(String paydate) {
        this.paydate = paydate;
    }

    public String getPaytime() {
        return paytime;
    }

    public void setPaytime(String paytime) {
        this.paytime = paytime;
    }

    public String getPaytype() {
        return paytype;
    }

    public void setPaytype(String paytype) {
        this.paytype = paytype;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBusinstatus() {
        return businstatus;
    }

    public void setBusinstatus(String businstatus) {
        this.businstatus = businstatus;
    }

    public String getCreatedate() {
        return createdate;
    }

    public void setCreatedate(String createdate) {
        this.createdate = createdate;
    }

    public String getPayOperatorname() {
        return payOperatorname;
    }

    public void setPayOperatorname(String payOperatorname) {
        this.payOperatorname = payOperatorname;
    }

    public Long getPayOperatorid() {
        return payOperatorid;
    }

    public void setPayOperatorid(Long payOperatorid) {
        this.payOperatorid = payOperatorid;
    }

    public String getShareType() {
        return shareType;
    }

    public void setShareType(String shareType) {
        this.shareType = shareType;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", serviceId=").append(serviceId);
        sb.append(", custname=").append(custname);
        sb.append(", custcode=").append(custcode);
        sb.append(", custno=").append(custno);
        sb.append(", corename=").append(corename);
        sb.append(", coreno=").append(coreno);
        sb.append(", coreoperorg=").append(coreoperorg);
        sb.append(", factoryname=").append(factoryname);
        sb.append(", factoryno=").append(factoryno);
        sb.append(", gatheringDate=").append(gatheringDate);
        sb.append(", loanBalance=").append(loanBalance);
        sb.append(", serviceCharge=").append(serviceCharge);
        sb.append(", shareScale=").append(shareScale);
        sb.append(", share=").append(share);
        sb.append(", settleaccountsType=").append(settleaccountsType);
        sb.append(", paydate=").append(paydate);
        sb.append(", paytime=").append(paytime);
        sb.append(", paytype=").append(paytype);
        sb.append(", description=").append(description);
        sb.append(", businstatus=").append(businstatus);
        sb.append(", createdate=").append(createdate);
        sb.append(", payOperatorname=").append(payOperatorname);
        sb.append(", payOperatorid=").append(payOperatorid);
        sb.append(", shareType=").append(shareType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ScfLoanShare other = (ScfLoanShare) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getServiceId() == null ? other.getServiceId() == null : this.getServiceId().equals(other.getServiceId()))
                && (this.getCustname() == null ? other.getCustname() == null : this.getCustname().equals(other.getCustname()))
                && (this.getCustcode() == null ? other.getCustcode() == null : this.getCustcode().equals(other.getCustcode()))
                && (this.getCustno() == null ? other.getCustno() == null : this.getCustno().equals(other.getCustno()))
                && (this.getCorename() == null ? other.getCorename() == null : this.getCorename().equals(other.getCorename()))
                && (this.getCoreno() == null ? other.getCoreno() == null : this.getCoreno().equals(other.getCoreno()))
                && (this.getCoreoperorg() == null ? other.getCoreoperorg() == null : this.getCoreoperorg().equals(other.getCoreoperorg()))
                && (this.getFactoryname() == null ? other.getFactoryname() == null : this.getFactoryname().equals(other.getFactoryname()))
                && (this.getFactoryno() == null ? other.getFactoryno() == null : this.getFactoryno().equals(other.getFactoryno()))
                && (this.getGatheringDate() == null ? other.getGatheringDate() == null : this.getGatheringDate().equals(other.getGatheringDate()))
                && (this.getLoanBalance() == null ? other.getLoanBalance() == null : this.getLoanBalance().equals(other.getLoanBalance()))
                && (this.getServiceCharge() == null ? other.getServiceCharge() == null : this.getServiceCharge().equals(other.getServiceCharge()))
                && (this.getShareScale() == null ? other.getShareScale() == null : this.getShareScale().equals(other.getShareScale()))
                && (this.getShare() == null ? other.getShare() == null : this.getShare().equals(other.getShare()))
                && (this.getSettleaccountsType() == null ? other.getSettleaccountsType() == null : this.getSettleaccountsType().equals(other.getSettleaccountsType()))
                && (this.getPaydate() == null ? other.getPaydate() == null : this.getPaydate().equals(other.getPaydate()))
                && (this.getPaytime() == null ? other.getPaytime() == null : this.getPaytime().equals(other.getPaytime()))
                && (this.getPaytype() == null ? other.getPaytype() == null : this.getPaytype().equals(other.getPaytype()))
                && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
                && (this.getBusinstatus() == null ? other.getBusinstatus() == null : this.getBusinstatus().equals(other.getBusinstatus()))
                && (this.getCreatedate() == null ? other.getCreatedate() == null : this.getCreatedate().equals(other.getCreatedate()))
                && (this.getPayOperatorname() == null ? other.getPayOperatorname() == null : this.getPayOperatorname().equals(other.getPayOperatorname()))
                && (this.getShareType() == null ? other.getShareType() == null : this.getShareType().equals(other.getShareType()))
                && (this.getPayOperatorid() == null ? other.getPayOperatorid() == null : this.getPayOperatorid().equals(other.getPayOperatorid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getServiceId() == null) ? 0 : getServiceId().hashCode());
        result = prime * result + ((getCustname() == null) ? 0 : getCustname().hashCode());
        result = prime * result + ((getCustcode() == null) ? 0 : getCustcode().hashCode());
        result = prime * result + ((getCustno() == null) ? 0 : getCustno().hashCode());
        result = prime * result + ((getCorename() == null) ? 0 : getCorename().hashCode());
        result = prime * result + ((getCoreno() == null) ? 0 : getCoreno().hashCode());
        result = prime * result + ((getCoreoperorg() == null) ? 0 : getCoreoperorg().hashCode());
        result = prime * result + ((getFactoryname() == null) ? 0 : getFactoryname().hashCode());
        result = prime * result + ((getFactoryno() == null) ? 0 : getFactoryno().hashCode());
        result = prime * result + ((getGatheringDate() == null) ? 0 : getGatheringDate().hashCode());
        result = prime * result + ((getLoanBalance() == null) ? 0 : getLoanBalance().hashCode());
        result = prime * result + ((getServiceCharge() == null) ? 0 : getServiceCharge().hashCode());
        result = prime * result + ((getShareScale() == null) ? 0 : getShareScale().hashCode());
        result = prime * result + ((getShare() == null) ? 0 : getShare().hashCode());
        result = prime * result + ((getSettleaccountsType() == null) ? 0 : getSettleaccountsType().hashCode());
        result = prime * result + ((getPaydate() == null) ? 0 : getPaydate().hashCode());
        result = prime * result + ((getPaytime() == null) ? 0 : getPaytime().hashCode());
        result = prime * result + ((getPaytype() == null) ? 0 : getPaytype().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getBusinstatus() == null) ? 0 : getBusinstatus().hashCode());
        result = prime * result + ((getCreatedate() == null) ? 0 : getCreatedate().hashCode());
        result = prime * result + ((getPayOperatorname() == null) ? 0 : getPayOperatorname().hashCode());
        result = prime * result + ((getShareType() == null) ? 0 : getShareType().hashCode());
        result = prime * result + ((getPayOperatorid() == null) ? 0 : getPayOperatorid().hashCode());
        return result;
    }

    public void initAdd() {
        this.id = SerialGenerator.getLongValue("ScfLoanShare.id");
    }
}